
#!/bin/sh 
set -e 

CONFIG_FILE1="/opt/tomcat/webapps/ROOT/WEB-INF/classes/jdbc.properties"
CONFIG_FILE2="/opt/tomcat/webapps/wts/WEB-INF/classes/jdbc.properties" 
CONFIG_FILE3="/opt/tomcat/conf/server.xml"
sed -i "s/8080/8986/g" "$CONFIG_FILE3"

if [ "$mysqlip" != "localhost" ] ; then 
	sed -i "s/localhost/$mysqlip/g" "$CONFIG_FILE1"
	sed -i "s/localhost/$mysqlip/g" "$CONFIG_FILE2"
fi 

if [ "$mysqlpassword" != "123456" ] ; then 
	sed -i "s/localhost/$mysqlpassword/g" "$CONFIG_FILE1"
	sed -i "s/localhost/$mysqlpassword/g" "$CONFIG_FILE2"
fi
 


   
#ENV    

/opt/tomcat/bin/catalina.sh run



















